using System;
using System.Collections.Generic;
using System.Text;
using System.Data.OleDb;
using System.Xml;
using System.Windows.Forms;

namespace CashierSystem
{
    public class DbConnection
    {
        protected static System.Data.OleDb.OleDbConnection conn = new System.Data.OleDb.OleDbConnection();
        private static String path = System.IO.Directory.GetCurrentDirectory();
        static DbConnection()
        {
            /*string s = Application.ExecutablePath;
            int dotPos = s.IndexOf(".");
            s = s.Substring(0, dotPos);
            s += ".xml";
            XmlDocument doc = new XmlDocument();
            doc.Load(s);
            XmlNode root = doc.DocumentElement;
            XmlNode setttingNode = root.SelectSingleNode("setting");
            string server = setttingNode.SelectSingleNode("server").InnerText;
            string db = setttingNode.SelectSingleNode("db").InnerText;
            string user = setttingNode.SelectSingleNode("user").InnerText;
            string password = setttingNode.SelectSingleNode("password").InnerText;CHINA-85461905A*/
            conn.ConnectionString = "Provider=SQLOLEDB.1;Password=congym";
            conn.ConnectionString += ";Persist Security Info=True;User ID=sa;";
            conn.ConnectionString += "Initial Catalog=cashier;Data Source=AAA-PC";
        }
        public static System.Data.OleDb.OleDbConnection getConn()
        {
            return conn;
        }
    }

}
